package com.qf.springcloud.client;

import com.qf.springcloud.factory.AirSearchClientFallbackFactory;
import com.qf.springcloud.fallback.AirSearchClientFallback;
import feign.RequestLine;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 映射air-search服务的controller资源
 */
@FeignClient(value = "AIR-SEARCH-V1",fallbackFactory = AirSearchClientFallbackFactory.class)
public interface AirSearchClient {


    // 映射上了air-search的test资源
    // 请求方式，请求的ip:port，请求的path
    // 请求参数
    // 响应数据
    @GetMapping("/air/search/test")
    public String test();



    @PostMapping("/air/search/test1")
    public String test1(@RequestParam(value = "id") Integer id,@RequestParam String name,@RequestParam String gender);

    @GetMapping("/air/search/test2/{brand}/{color}")
    public String test2(@PathVariable(value = "brand") String brand, @PathVariable String color);

    @PostMapping("/air/search/test3")
    public String test3(@RequestBody Map map);
}
